using DimensionsHelper.LanguageService.Symbols;
using DimensionsHelper.LanguageService.Syntax;

namespace DimensionsHelper.LanguageService;

public class AnalysisEventSection : AnalysisStatementWithDomain
{

    private AnalysisBlock _body;
    
    public AnalysisEventSection(EventSection eventSection, SectionSymbol eventSymbol, AnalysisTree? parent) : 
        base(AnalysisBoundKinds.EventSection, eventSection, eventSymbol, parent)
    {
        Syntax = eventSection;
        _body = AnalysisNodeFactory.Block(eventSection.Body, this, null);
        Children.Add(_body);
    }
    
    internal void UpdateBody(AnalysisBlock body)
    {
        _body = body;
    }
    
    public override EventSection Syntax { get; }

    public override AnalysisBlock Body => _body;
    
}
